<#include "../../common/nolayout.ftl"/>
<@html css_=['life/m/role.css'] js_=['life/blog/blog_type.js']>

<body class="childrenBody">
<blockquote class="layui-elem-quote news_search">
    <form class="layui-form" id="listForm" action="${root}/m/blogtype/list" method="post">
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input type="text" value="" id="blogtypeName" name="blogtypeName" placeholder="请输入菜单名称" class="layui-input search_input">
            </div>
            <a class="layui-btn search_btn" lay-submit lay-filter="queryForm">查询</a>
            <div class="layui-inline">
                <a class="layui-btn layui-btn-normal blogtypeAdd_btn">添加父级菜单</a>
            </div>
        </div>
    </form>
</blockquote>
<div class="layui-form news_list">
    <table class="layui-table">
        <thead>
        <tr>
            <th>类型名称</th>
            <th>类型icon</th>
            <th>状态</th>
            <th>排序</th>
            <th>创建时间</th>
            <th>更新时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody id="listDataBody"></tbody>
    </table>
</div>
<div id="page"></div>
</body>

<script type="text/html" id="addblogtype">
    <form class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label">类型名称</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input blogtypeName" name="name" maxlength="16" placeholder="请输入类型名称">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">类型icon</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input blogtypeIcon" name="icon" maxlength="16" placeholder="请输入类型icon">
            </div>
        </div>
    </form>
</script>

<script id="dataListTpl" type="text/html">
    {{#  if(d.list!=null&&d.list.length> 0){ }}
    {{#  layui.each(d.list, function(index, item){ }}
    <tr>
        <td>{{item.name||''}}</td>
        <td>{{item.icon||''}}</td>
        <td>
            {{# if(item.status=== 0){ }}
            显示
            {{#} else{ }}
            隐藏
            {{# } }}
            <input type="checkbox" data-id="{{item.id}}" name="show" class="roleFrozen" lay-skin="switch" lay-text="是|否" lay-filter="isShow"
                   {{# if(item.status == -1){ }}checked="checked" {{# } }} />
        </td>
        <td>{{item.sort||''}}</td>
        <td>{{ layui.util.toDateString(item.insertDate, 'yyyy-MM-dd HH:mm:ss') }}</td>
        <td>{{ layui.util.toDateString(item.lastUpdate, 'yyyy-MM-dd HH:mm:ss') }}</td>
        <td>
            <div class="layui-btn-container">
                <a class="layui-btn layui-btn-xs blogtypeEdit" data-id="{{item.id}}"><i class="layui-icon">&#xe642;</i> 编辑</a>
                <a class="layui-btn layui-btn-xs layui-btn-danger blogtypeDel" data-id="{{item.id}}"><i class="layui-icon">&#xe640;</i> 删除</a>
            </div>
        </td>
    </tr>
    {{#  }); }}
    {{#} else { }}
    <tr>
        <td colspan="7" style="text-align: center">无数据</td>
    <tr/>
    {{# }}}

</script>
</@html>